package entity;

import lombok.Data;

import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

@Data
public class AcademyEntity {
    private String id;
    private String academyName;
    private String academyCode;

    public static AcademyEntity mapToEntity(Map<String, Object> objectMap) {
        AcademyEntity academy = new AcademyEntity();
        academy.setId((String) objectMap.get("id"));
        academy.setAcademyName((String) objectMap.get("academy_name"));
        academy.setAcademyCode((String) objectMap.get("academy_code"));
        return academy;
    }

    public static List<AcademyEntity> mapListToEntityList(List<Map<String, Object>> objectMapList) {
        return objectMapList.stream().map(AcademyEntity::mapToEntity).collect(Collectors.toList());
    }
}
